cmake_minimum_required(VERSION 3.5)

project(main_page LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt5 5.15 COMPONENTS Widgets REQUIRED)

set(CMAKE_AUTOMOC ON)
# 添加与QtKeyboard相同的宏定义
add_definitions(-DENABLED_CHINESE_LIB -DENABLED_CHINESE_PHRASE_LIB -DENABLED_GOOGLE_CHINESE_LIB)

add_library(main_page SHARED
    src/main_page.cpp
    include/main_page.h
    src/main_page.ui
)

target_include_directories(main_page PUBLIC 
    include
    $<TARGET_PROPERTY:main_page,AUTOGEN_INCLUDE_DIR>
)

target_link_libraries(main_page Qt5::Widgets cabinet_collect_dialog cabinet_return_dialog
                          cabinet_halfway_dialog  cabinet_longrent_dialog admin_dialog board_utils)